/<template>
  <div class="home">
    <Head>
      <template v-slot:head> </template>
    </Head>
    <Banner>
      <template v-slot:banner> </template>
    </Banner>

    <List>
      <template v-slot:list> </template>
    </List>
    <div v-for="(item,index) in list" :key="index">
      <Goods :item="item" :index='index'>
        <template v-slot:goods>
          <button @click="item.num++">加</button>
        </template>
      </Goods>
    </div>
  </div>
</template>

<script>
import Head from "../components/Head.vue";
import Banner from "../components/Banner.vue";
import List from "../components/List.vue";
import Goods from "../components/Goods.vue";
import axios from "axios";
export default {
  components: {
    Head,
    Banner,
    List,
    Goods,
  },
   data() {
    return {
      list: [],
    };
  },
  methods: {},
  mounted() {
    axios.get("/goods").then((res) => {
        console.log(res.data);
      this.list = res.data;
    });
  },
};
</script>

<style lang='scss'>
</style>